package zjitc.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import zjitc.interceptor.MyInterceptor;

/*
    @author： 尤安托
    @date： 2024/12/17 15:07
*/
@Configuration
public class MvcConfig implements WebMvcConfigurer {
    @Bean
    public MyInterceptor myInterceptor(){
        return new MyInterceptor();
    }
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
       registry.addInterceptor(myInterceptor()).addPathPatterns("/*");
    }
}
